<script setup>
import { computed, ref } from 'vue'

const score = ref([87, 89, 90, 56, 78, 100])

const goodScore = computed(() => {
  return score.value.filter(item => item >= 90)
})
// 计算属性的完整写法
// const badScore = computed({
//   get() {
//     return 0
//   },
//   set() {
//   }
// })

</script>

<template>
  <div>
    <div>成绩数组：{{ score }}</div>
    <div>好的成绩：{{ goodScore }}</div>
  </div>
</template>

<style scoped></style>